#!/bin/bash
#make  f1c100s_nano_linux_defconfig



addr="/home/yellow/sdk/Linux/arch/arm/boot"
root="/media/yellow/root"
uboot="/media/yellow/uboot"

read -p "1.make
	2.send tf 
	3. gedit dts.sh
	
	"  a

if [ $a == 1 ] ;then
	#make make ARCH=arm yellow_defconfig
	make  -j8   
	make -j8 INSTALL_MOD_PATH=out modules_install &&
	
	ls -l $addr/zImage  &&
ls -l $addr/dts/suniv-f1c100s-licheepi-nano.dtb &&

ls  -l	/home/yellow/sdk/Linux/out/lib/modules  

fi




#send tf

if [ $a == 2 ] ;then  

	
blkid



read -p "write tf address"  addr


tf1="${addr}1"
tf2="${addr}2"



mount /dev/$tf1  /media/yellow/uboot
mount /dev/$tf2  /media/yellow/root

cp /home/yellow/sdk/Linux/arch/arm/boot/zImage  $uboot  &&
cp /home/yellow/sdk/Linux/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb $uboot &&
cp -r /home/yellow/sdk/Linux/out/lib/modules  $root/lib   &&

	
ls -l $root/lib  &&

ls -l /media/yellow/uboot/zImage &&
ls -l /media/yellow/uboot/suniv-f1c100s-licheepi-nano.dtb 




fi

  


if [ $a == 3 ] ;then
      	
gedit /home/yellow/sdk/Linux/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts  &
gedit /home/yellow/sdk/Linux/arch/arm/boot/dts/suniv.dtsi
	
	

fi



#make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8 INSTALL_MOD_PATH=out modules
#make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8 INSTALL_MOD_PATH=out modules_install

